package com.gupaowork.pattern.observer.guava;

import com.google.common.eventbus.Subscribe;
import com.gupaowork.pattern.observer.Question;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * @Author heweicheng
 * @Date 2020/10/4
 */
@Service
@Repository
public class GuavaTeacher {
    private final String name;

    public GuavaTeacher(String name) {
        this.name = name;
    }

    @Subscribe
    public void subscribe(Question question){
        System.out.println(name + "老师，你好！你收到了来自"+question.getName() +"的提问，内容是："+question.getContent());
    }
}
